Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to add subchecks #19

Merged
merged 5 commits into from
Jun 11, 2024
Merged

Refactor to add subchecks #19

merged 5 commits into from
Jun 11, 2024

Conversation

martialblog
Copy link
Member

To implement this feature in #17 I had to refactor some of the code. Mainly there's now a bit more parsing of the check.php endpoint happening.

Also the output logic now works with multiple "sub-checks" and outputs to determine the final exit code.

Example:

check_brevisone.py -H localhost:8000 --protocol http --failed-critical 18 --failed-warning 15   
[CRITICAL] - Brevis.One SMS Gateway Status
 \_[OK] Failed sending: 12
 \_[OK] Signal strength: 95
 \_[CRITICAL] Que length: 23
|que=23 failed=12 signal=95 total=885 time=1713865490 disk=1400246272 

A --debug flag was introduced to return the full check.php endpoint output.

Fixes #17

@martialblog martialblog self-assigned this Jun 3, 2024
@martialblog martialblog requested a review from RincewindsHat June 3, 2024 11:51
@martialblog martialblog added this to the v4.0.0 milestone Jun 3, 2024
check_brevisone Outdated Show resolved Hide resolved
@RincewindsHat
Copy link
Member

Do I understand https://docs.brevis.one/current/en/Content/Functionality/Status%20Functions/Monitor%20the%20SMS%20Gateway.htm correctly in that, that the disk value is close to uselesse since I have lookup the full capacity manually?

@martialblog
Copy link
Member Author

martialblog commented Jun 5, 2024

I don't understand it either. The API docs say "Specifies how much internal memory is occupied (bytes)", would be nice to see how much is left instead

Copy link
Member

@RincewindsHat RincewindsHat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from that one thing, I think that's good to go.

check_brevisone Outdated Show resolved Hide resolved
@RincewindsHat
Copy link
Member

merge when ready

@martialblog martialblog merged commit c1168b7 into main Jun 11, 2024
4 checks passed
@martialblog martialblog deleted the feature/add-disk-check branch October 30, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Set hard disk threshold values
2 participants